<?php

//数据中心模式
class ProductDataCenter
{
    public static $objectList = [];

    public static function set($k, $v){
        self::$objectList[$k] = $v;
    }

    /*public static function get($k){
        return self::$objectList[$k];
    }*/

    public static function remove($k){
        unset(self::$objectList[$k]);
    }

    public static function __callStatic(string $name, array $arguments)
    {
        $return = [];
        foreach (self::$objectList as $k => $v){
            if (method_exists($v, $name)){
                $ret = $v->$name($arguments);
                if ($ret){
                    $return[] = $ret;
                }
            }
        }
        return $return;
    }
}